//
//  XUSendPhotoCell.m
//  新浪微博
//
//  Created by xuwenxin on 15-4-17.
//  Copyright (c) 2015年 xuwenxin. All rights reserved.
//

#import "XUSendPhotoCell.h"

@interface XUSendPhotoCell ()
//@property (weak, nonatomic) IBOutlet UIButton *addPhoto;

@property (weak, nonatomic) IBOutlet UIButton *clearPhoto;

@property (weak, nonatomic) IBOutlet UIImageView *imgView;

@end

@implementation XUSendPhotoCell

//- (IBAction)addPhoto:(id)sender {
//    NSLog(@"添加加号");
//
//    if ([_delegate respondsToSelector:@selector(XUSendPhotoCellDelegatePicker)]) {
//        [_delegate XUSendPhotoCellDelegatePicker];
//    }
//    
//}
- (IBAction)clearPhoto:(id)sender {
    NSLog(@"%@",[sender superview]);
    if ([_delegate respondsToSelector:@selector(XUSendPhotoCellDelegateClearPhotosWith:)]) {
        [_delegate XUSendPhotoCellDelegateClearPhotosWith:self.path];
    }
}

- (void)setImg:(UIImage *)img
{
    _img = img;
    if (_img != nil) {
        NSLog(@"%s",__func__);
        self.imgView.image = nil;
        self.imgView.image = self.img;
    } 
}

- (void)setPath:(NSInteger)path
{
    _path = path;
    self.clearPhoto.tag = path;
}

@end
